home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
MSDIR.A
< prev
next >
Wrap
Text File
|
1985-05-17
|
2KB
|
86 lines
; msdir.a - MS-DOS directory functions.
; (C) Copyright 1984, 1985 Gregory R. Mansfield - All Rights Reserved.
; G. R. Mansfield. 84/07/25.
; Ver 1.0-5517.
include "include/msdos.ah"
dseg
public errno_
cseg
public mscdt_
public msfmf_
public msfnf_
public msmde_
; int mscdt(drive, buf) /* return text of current directory */
; char *buf;
; int drive;
mscdt_:
mov bx,sp
mov si,[bx+4] ; pointer to buffer
mov dx,[bx+2] ; drive
xor bx,bx ; preset no error
mov ah,FR_CDT
int I_FCN
jnb cdt1 ; if no error
mov errno_,ax
dec bx
cdt1: xchg ax,bx
ret
; int msfmf(name, attr, buf) /* find match file */
; char *name;
; int attr;
; BYTE *buf;
msfmf_:
mov bx,sp
mov dx,[bx+6] ; buffer address
mov ah,FR_DTA ; set disk transfer address
int I_FCN
mov cx,[bx+4] ; attributes
mov dx,[bx+2] ; pointer to path name
xor bx,bx ; preset no error
mov ah,FR_FMF ; find match file
int I_FCN
jnb fmf1 ; if no error
mov errno_,ax
dec bx
fmf1: xchg ax,bx
ret
; int msfnf() /* find next matching file */
msfnf_:
xor bx,bx ; preset no error
mov ah,FR_FNF ; step through directory matching files
int I_FCN
jnb fnf1 ; if no error
mov errno_,ax
dec bx
fnf1: xchg ax,bx
ret
; int msmde(source, dest) /* move directory entry */
; char *source, *dest)
msmde_:
mov bx,sp
mov di,[bx+4] ; pointer to new pathname
mov dx,[bx+2] ; pointer to existing pathname
xor bx,bx ; preset no error
mov ah,FR_MDE
int I_FCN
jnb mde1 ; if no error
mov errno_,ax
dec bx
mde1: xchg ax,bx
ret